//1.导入vue和router包
import Vue from 'vue'
import VueRouter from 'vue-router'

//2.调用Vue.use()函数，把 VueRouter 安装为 Vue 的插件
Vue.use(VueRouter)

//3.创建路由的示例对象
const routes = [
    {
        path: '/',
        redirect: '/game-box',
    },
    {
        path: '/game-box',
        component: () => import('@/views/GameBox/index.vue'),
    },
    {
        path: '/404',
        component: () => import('@/views/404/index.vue'),
    },

    // 404 page must be placed at the end !!!
    { path: '*', redirect: '/404' }
]

const router = new VueRouter({
    routes
})

//4.向外共享路由示例对象
export default router